package com.ibeeking.found.upms.b.rest.controller.v1.feign;

import com.ibeeking.found.upms.api.common.param.PermissionParam;
import com.ibeeking.found.upms.b.rest.service.ITenantPermissionService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import javax.validation.constraints.NotBlank;
import java.util.List;

/**
 * @ClassName PermissionController控制器
 * @Description
 * @Author ibeeking
 * @Date 2020-12-01 18:15
 **/
@RestController
@RequestMapping("/b/permission/feign/v1")
public class PermissionFeignController {

    @Resource
    private ITenantPermissionService permissionServiceImpl;

    @PostMapping(value = "/menus/{module}")
    public List<Long> menus(@PathVariable("module") @NotBlank(message = "模块不能为空") String module) {
        return permissionServiceImpl.queryAllByModule(module);
    }

    @PostMapping(value = "/configurePermission")
    public Boolean configurePermission(@RequestBody List<PermissionParam> params) {
        return permissionServiceImpl.configurePermission(params);
    }
}
